{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_tcwq/template/public/ygcsslist.css">
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>    
    <li class="active"><a href="{php echo $this->createWebUrl('zxtype')}">资讯分类管理</a></li>
    <li><a href="{php echo $this->createWebUrl('addzxtype')}">添加信息分类</a></li>
</ul>
<div class="main">
    <!-- 门店列表部分开始 -->

        <div class="panel panel-default">

            <div class="panel-heading">
                资讯分类管理
            </div>
            <div class="panel-body" style="padding: 0px 15px;">
                <div class="row">
                    <table class="yg5_tabel col-md-12">
                        <tr class="yg5_tr1">
                            <td class="store_td1 col-md-1">顺序</td>
                            <td class="col-md-2">分类图标</td>
                            <td class="col-md-2">分类名称</td>
                            <!-- <td class="col-md-2">价格</td> -->
                            <td class="col-md-3">操作</td>
                        </tr>
                        {loop $list $row}
                        <tr class="yg5_tr2">
                            <td class="num{$row['id']}">
                            	<span class="numspan{$row['id']}">{$row['sort']}</span>
                        		<input style="display: none;width: 100%;" type="number" name="num{$row['id']}" class="numinp{$row['id']}" value="{$row['num']}" />
                            <!--     <script type="text/javascript">
                                    $(function(){
                                        $(".num{$row['id']}").each(function(index){
                                             $(this).dblclick(function(){
                                                $(".numinp{$row['id']}").eq(index).show().focus();
                                                $(".numspan{$row['id']}").eq(index).hide();                                            
                                            });
                                        });
                                        $(".numinp{$row['id']}").each(function(index){
                                            $(this).blur(function(){            
                                                $(".numinp{$row['id']}").eq(index).hide();
                                                $(".numspan{$row['id']}").eq(index).show();
                                                var text = $(".numspan{$row['id']}").html();
                                                var inp = $(" input[ name='num{$row['id']}' ] ").val();
                                                $(".numspan{$row['id']}").html(inp);
                                                console.log(inp);
                                                id = {$row['id']};
                                                num = inp;
                                                $.ajax({
                                                    type:"post",
                                                    url:"{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&do=UpdType&m=zh_tcwq",
                                                    dataType:"text",
                                                    data:{id:id,num:num},
                                                    success:function(data){
                                                        console.log(data);
                                                    }
                                                })
                                        
                                            });
                                        });
                                    })
                                </script> -->
                            </td>
                            <td>
                                <img class="store_list_img" src="{media  $row['icon']}" alt=""/>                                
                            </td>
                            <td>{$row['type_name']}</td>
                        <!--     <td class="money{$row['id']}">
                            <span class="moneyspan{$row['id']}">{$row['money']}</span>
                                <input style="display: none;width: 100%;" type="text" name="money{$row['id']}" class="moneyinp{$row['id']}" value="{$row['money']}" />
                                <script type="text/javascript">
                                    $(function(){
                                        $(".money{$row['id']}").each(function(index){
                                             $(this).dblclick(function(){
                                                $(".moneyinp{$row['id']}").eq(index).show().focus();
                                                $(".moneyspan{$row['id']}").eq(index).hide();                                            
                                            });
                                        });
                                        $(".moneyinp{$row['id']}").each(function(index){
                                            $(this).blur(function(){            
                                                $(".moneyinp{$row['id']}").eq(index).hide();
                                                $(".moneyspan{$row['id']}").eq(index).show();
                                                var text = $(".moneyspan{$row['id']}").html();
                                                var inp = $(" input[ name='money{$row['id']}' ] ").val();
                                                $(".moneyspan{$row['id']}").html(inp);
                                                // console.log(inp);
                                                id = {$row['id']};
                                                money = inp;
                                                $.ajax({
                                                    type:"post",
                                                    url:"{$_W['siteroot']}/app/index.php?i={$_W['uniacid']}&c=entry&do=UpdType&m=zh_tcwq",
                                                    dataType:"text",
                                                    data:{id:id,money:money},
                                                    success:function(data){
                                                        console.log(data);
                                                    }
                                                })
                                        
                                            });
                                        });
                                    })
                                </script>
                        </td> -->
                            <td>
                                <a href="{php echo $this->createWebUrl('addzxtype', array('id' => $row['id']))}" class="storespan btn btn-xs">
                                    <span class="fa fa-pencil"></span>
                                    <span class="bianji">编辑
                                        <span class="arrowdown"></span>
                                    </span>                            
                                </a>
                                <a href="javascript:void(0);" class="storespan btn btn-xs" data-toggle="modal" data-target="#myModal{$row['id']}">
                                    <span class="fa fa-trash-o"></span>
                                    <span class="bianji">删除
                                        <span class="arrowdown"></span>
                                    </span>
                                </a>                                
                            <!-- <a class="btn btn-warning btn-xs" href="{php echo $this->createWebUrl('addzxtype', array('id' => $row['id']))}" title="编辑">改</a>&nbsp;&nbsp;
                           <button type="button" class="btn btnblue btn-xs" data-toggle="modal" data-target="#myModal{$row['id']}">删</button> -->
                            </td>
                        </tr>
                         <div class="modal fade" id="myModal{$row['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                      <div class="modal-dialog" role="document">
                        <div class="modal-content">
                          <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                        </div>
                        <div class="modal-body" style="font-size: 20px">
                            确定删除么？
                        </div>
                        <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                            <a href="{php echo $this->createWebUrl('zxtype', array('op'=>'delete','id' => $row['id']))}" type="button" class="btn btn-info" >确定</a>
                        </div>
                    </div>
                </div>
            </div>
                        {/loop}
                       {if empty($list)}
                            <tr class="yg5_tr2">
                            <td colspan="4">
                                  暂无商家信息
                              </td>
                          </tr>
                          {/if}
                    </table>
                </div>
            </div>
        </div>
    {$pager}
</div>
<script type="text/javascript">
    $(function(){
        $("#frame-3").show();
        $("#yframe-3").addClass("wyactive");
    })
</script>{template 'common/footer'}